package com.yuexun.dhdoctor.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;

import com.yuexun.dhdoctor.R;


/**
 * Created by Administrator on 2017/5/12 0012.
 */

public class ToastDialog extends Dialog {
    private TextView tv;

    private String title = "";

    public ToastDialog(Context context, String title) {
        super(context, R.style.loadingDialogStyle);
        this.title = title;
    }

    private ToastDialog(Context context, String title, int theme) {
        super(context, theme);
        this.title = title;
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_toast);
        tv = (TextView)this.findViewById(R.id.showTxt);
        tv.setText(title);

        new Handler().postDelayed(new Runnable(){
            public void run() {
                //execute the task
                dismiss();
            }
        }, 1000);

    }
}
